package com.cg.controller;

import com.cg.client.AppClient;
import com.cg.dto.OrderDto;
import com.cg.dto.OrderListPageDto;
import com.cg.dto.Result;
import com.cg.vo.OrderDetailVo;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @ClassName OrderController
 * @Description TODO
 * @Author CG
 * @Date 2024/1/12 11:02
 **/
@RestController
@RequestMapping("/order")
public class OrderController {

    @Resource
    private AppClient appClient;

    /**
     * 患者预约
     */
    @PostMapping("/createOrder")
    public Result createOrder(OrderDto orderDto){
        return appClient.createOrder(orderDto);
    }



    /**
     * 查询预约成功通知列表
     */
    @PostMapping("/orderList")
    public Result<Map<String,Object>> orderListByPatientId(OrderListPageDto orderListPageDto){
        return appClient.orderListByPatientId(orderListPageDto);
    }


    /**
     * 根据orderNum查询详情
     */
    @GetMapping("/queryOrderDetailByOrderNum")
    public Result<OrderDetailVo> queryOrderDetailByOrderNum(String orderNum){
        return appClient.queryOrderDetailByOrderNum(orderNum);
    }
}
